/*
 * @Description: 组件Map
 * @Author: seadon
 * @LastEditors: seadon
 * @Date: 2021-05-18 14:53:04
 * @LastEditTime: 2021-05-18 20:27:03
 */
import { Component } from 'vue'
import { Input, Select, Switch, Checkbox } from 'ant-design-vue'
import { ComponentType } from '../../types/table'

const componentMap = new Map<ComponentType, Component>()

componentMap.set('Input', Input)
componentMap.set('Select', Select)
componentMap.set('Switch', Switch)
componentMap.set('Checkbox', Checkbox)

export function add(compName: ComponentType, component: Component) {
	componentMap.set(compName, component)
}

export function del(compName: ComponentType) {
	componentMap.delete(compName)
}

export { componentMap }
